package com.cskaoyan.dbutils.resultsetHandler;

import com.cskaoyan.opensource.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.ScalarHandler;

import java.sql.SQLException;

/**
 * 创建日期: 2022/11/19 09:50
 *
 * @author ciggar
 */
public class ScarlarHandlerDemo {


    public static void main(String[] args) throws SQLException {

        QueryRunner queryRunner = new QueryRunner(DruidUtils.getDataSource());

        Long count = queryRunner.query("select count(*) from account", new ScalarHandler<Long>());

        System.out.println("count:" + count);

    }
}
